<html>
 <head></head>
 <body>
  <meta charset="UTF-8" /> 
  <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport" /> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> 
    <link href="/resource/ui-framework/easyui-1.5.2/themes/metro/easyui-c5a176a3d4.css" rel="stylesheet" />
    <link href="/resource/ui-framework/easyui-1.5.2/themes/icon-77a4ded0c8.css" rel="stylesheet" />
    <link href="/resource/ui-framework/bootstrap/3.0.3/css/bootstrap-a067b6d831.min.css" rel="stylesheet" />
    <link href="/resource/ui-framework/bootstrap-daterangepicker/css/daterangepicker-886dba62c4.css" rel="stylesheet" />
    <link href="/resource/ui-framework/font-awesome/css/font-awesome-a81d284b37.css" rel="stylesheet" />
    <link href="/resource/ui-framework/admin-lte/css/AdminLET-7d58b99a7e.css" rel="stylesheet" />
    <link href="/static/css/base-dc47892812.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/searchbox/css/searchbox-398327fb84.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/pager/css/pager-f077f5e880.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/status/css/status-5f59ab3856.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/selector/css/selector-23060c280e.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/button/css/button-5ef10c798a.css" rel="stylesheet" />
    <link href="/resource/ui-framework/jason/orderarrow/css/orderarrow-dcf8eba7d1.css" rel="stylesheet" />
    <link href="/static/css/table-0e491bc98f.css" rel="stylesheet" />
    <link href="/static/css/easyui-ext-372f902530.css" rel="stylesheet" />  
<div class="easyui-window panel-body panel-body-noborder window-body" id="window" data-options="modal:true,closed:true,minimizable:false,maximizable:false,collapsible:false,width:600,height:400" title="" style="width: 488px; height: 465px;">
<div class="container" style="width:100%;">
    <div class="row">
        <ul class="add-list filter-box">
            <li class="clearfix">
                <div class="items fl">订单编号：</div>
			    <div class="fill-items fl">{$data.number}</div>
            </li>
            <li class="clearfix">
                <div class="items fl">接单价：</div>
			    <div class="fill-items fl">{$data.price} 元</div>
            </li>
            <li class="clearfix">
                <div class="items fl">其他支出：</div>
			    <div class="fill-items fl">
                    <span class="textbox" style="width: 128px;"><input autocomplete="off" tabindex="" placeholder="" style="margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 24px; line-height: 24px; width: 126px;" type="text" name="orther_paymoney"></span> 元
                    <span style="color:red;">已支出的成本金额</span>
			    </div>
            </li>
            <li class="clearfix">
                <div class="items fl">退款金额：</div>
			    <div class="fill-items fl">
                    <span class="textbox" style="width: 128px;"><input autocomplete="off" tabindex="" placeholder="" style="margin: 0px; padding-top: 0px; padding-bottom: 0px; height: 24px; line-height: 24px; width: 126px;" type="text" name="back_paymoney"></span> 元
                    <span style="color:red;">已支出的成本金额</span>
			    </div>
            </li>
            <li class="clearfix">
                <div class="items fl">退款原因：</div>
			    <div class="fill-items fl" style="height:auto;">
                    <textarea cols="17" rows="4" id="txtComment" name="back_reason"></textarea>
			    </div>
            </li>
        </ul>
    </div>
    <div class="row">
        <div class="col-md-12 mt10" style="text-align:center;">
            <input class="btn-action" value="确定" id="btnConfirmRefund">
            <input class="btn-action" value="取消" onclick="javascript:$('#window').window('close')">
        </div>
    </div>
</div>
</div>
<script src="/resource/libs/jquery/jquery.js"></script>
<script src="/static/js/layer/layer.js"></script>
<script type="text/javascript">
    $().ready(function () {
        $('#btnConfirmRefund').on('click', function () {

           var  id = "{$data.id}";
           var  orther_paymoney = $('input[name=orther_paymoney]').val();
           var  back_paymoney = $('input[name=back_paymoney]').val();
           var  back_reason = $('#txtComment').val();           
            if (back_paymoney == 0) {
                layer.msg('退款金额不能为0');
                return;
            }
            if ($.trim(back_reason) == '') {
                layer.msg('退款原因必须填写');
                return;
            }
            $.post('/index/index/callback', {id:id,orther_paymoney:orther_paymoney,back_paymoney:back_paymoney,back_reason:back_reason}, function (res) {
              layer.msg(res.msg);
              if(res.code == 1){
                  window.setTimeout(function(){
                      window.parent.location.reload();
                  },1000);
              }
            });
        });
    });
</script>
</body>
</html>